import {
  getClassifyApi,
  postMsbdApi,
  getClassifysApi
} from '../../api/msbd'

export default {
  namespaced: true,
  state: {
    list: [],
    classify: []
  },
  mutations: {
    SET_LIST(state, list) {
      state.list = list
    },
    SET_CLASSIFY(state, classify) {
      state.classify = classify
    }
  },
  actions: {
    async getList({
      commit
    }) {
      let r = await getClassifyApi()
      commit('SET_LIST', r.data)
      console.log(r)
    },
    async postMsbd({
      commit
    }, form) {
      await postMsbdApi(form)
    },

    async getClassify({
      commit
    }) {
      let r = await getClassifysApi()
      commit('SET_CLASSIFY', r.data)
      console.log(r)
    }
  },
  getters: {}
}
